import {Page} from 'ionic-angular';
import {NavController, NavParams} from 'ionic-angular';
import {ImgPathPipe} from '../../pipes/img-path';
import {CurrencyCnyPipe} from '../../pipes/currency-cny';

import {ShoppingcartService}    from '../../services/shoppingcart';

@Page({
  templateUrl: 'build/pages/shoppingcart/shoppingcart.html',
  providers: [ShoppingcartService],
  pipes: [ImgPathPipe,CurrencyCnyPipe]
})
export class Shoppingcart {
    cart: any;
    errorMessage: any;

    constructor(private nav: NavController, private _shoppingcartService: ShoppingcartService) {
        let me = this;
        this._shoppingcartService.getData().subscribe(
            json => this.cart = json.data,
            error => this.errorMessage = <any>error
        );
    }
}
